package io.lkt.modules.sys.dao;

import io.lkt.modules.sys.entity.BBrandInfoEntity;
import io.lkt.modules.sys.entity.BUserBrandInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.lkt.modules.sys.entity.BUserInfoEntity;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * 用户品牌信息表
 * 
 * @author xss
 * @email dustwas@163.com
 * @date 2019-03-11 14:40:57
 */
@Mapper
public interface BUserBrandInfoDao extends BaseMapper<BUserInfoEntity>{
    Integer queryTotal(Map<String, Object> map);

    List<BUserBrandInfoEntity> queryList(Map<String, Object> map);

    Integer vipTotal(Integer brand_id);

    Map<String,Object> articleTotal(Integer brand_id);

    Integer tencentTotal(Integer brand_id);

    List<BUserBrandInfoEntity> queryUser(Map<String, Object> map);

    Integer queryUserTotal(Map<String, Object> map);

    Integer mergeBrand(BUserBrandInfoEntity bUserBrandInfoEntity);

    Integer delUserBrand(Integer brandId);

    /**
     * 修改用户所有品牌有效状态
     * @param userId
     * @return
     */
    int updateUserBrandEffectiveStatus(Integer userId);

    /**
     * 查询用户品牌状态
     * @param userBrandInfo
     * @return
     */
    BUserBrandInfoEntity queryUserBrandStatusInfo(BUserBrandInfoEntity userBrandInfo);

    /**
     * 添加用户品牌
     * @param record
     * @return
     */
    int addUserBrandInfo(BUserBrandInfoEntity record);

    /**
     * 更新用户品牌
     * @param record
     * @return
     */
    int updateUserBrandInfo(BUserBrandInfoEntity record);

    /**
     * 获取用户品牌信息
     * @param userId
     * @return
     */
    List<BUserBrandInfoEntity> queryUserBrandInfo(Integer userId);

    /**
     * 修改用户指定微站选中状态
     * @param userBrandInfo
     * @return
     */
    int updateUserSpecialBrandStatus(BUserBrandInfoEntity userBrandInfo);

    Integer getUserBrandCount(@Param("userId") Integer userId);

    List<BUserBrandInfoEntity> getUserBrand(Map<String, Object> map);

    BUserBrandInfoEntity getSimplyInfoById(@Param("id") Integer id);

    @Update("update b_user_brand_info set brand_poster = #{brandPoster} where id = #{id}")
    int updateUserBrandPoster(@Param("id") Integer id, @Param("brandPoster") String brandPoster);

    BBrandInfoEntity getUserLatestBrandInfo(Integer userId);
}
